<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>库存预警</title>
    <link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div class="container">
    <h1 style="text-align:center;margin-bottom:40px;">库存预警</h1>
    <div style="width:100%;background:#fff;box-shadow:0 2px 5px rgba(0,0,0,0.05);padding:16px 0 8px 0;display:flex;justify-content:flex-end;align-items:center;position:sticky;top:0;z-index:10;">
        <a href="/dishes" class="order-btn" style="margin-right:20px;width:auto;padding:6px 18px;">返回菜单</a>
        <a href="/logout" class="order-btn" style="margin-right:40px;width:auto;padding:6px 18px;background:#e44d26;">退出登录</a>
    </div>
    <c:choose>
        <c:when test="${empty lowStockDishes}">
            <div style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:200px;">
                <p style="font-size:1.2em;color:#888;margin-bottom:20px;">暂无库存预警菜品。</p>
                <a href="/dishes" class="order-btn" style="padding:10px 30px;font-size:1.1em;">返回菜单</a>
            </div>
        </c:when>
        <c:otherwise>
            <table style="width:100%;background:white;border-radius:8px;box-shadow:0 2px 5px rgba(0,0,0,0.1);">
                <thead>
                <tr>
                    <th>菜品</th>
                    <th>图片</th>
                    <th>价格</th>
                    <th>库存</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${lowStockDishes}" var="dish">
                    <tr>
                        <td>${dish.name}</td>
                        <td><img src="${dish.imageUrl}" alt="${dish.name}" style="width:60px;height:40px;"></td>
                        <td>￥${dish.price}</td>
                        <td style="color:red;">${dish.stock}</td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </c:otherwise>
    </c:choose>
</div>
</body>
</html> 